﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace BoriPeter.NutritionManager.FatSecret
{
    [XmlRoot("foods", Namespace = "http://platform.fatsecret.com/api/1.0/")]
    public class FoodsSearchModel
    {
        /* ******** The general information returned is: ****** */

        /* is an Int – the maximum size of a page of results. */
        [XmlElement("max_results")]
        public int MaxResultsPerPage { get; set; }

        /* is an Int – the total number of search results matching the search expression. */
        [XmlElement("total_results")]
        public int TotalResults { get; set; }

        /* is an Int – the zero-based offset into the results for the query. */
        [XmlElement("page_number")]
        public int PageNumber { get; set; }

        /* Each food element contains summary information about the food item as follows: */
        [XmlElement("food")]
        public FoodsSearchFood[] Foods { get; set; }
    }

    public class FoodsSearchFood
    {
        /* the unique food identifier. */
        [XmlElement("food_id")]
        public int FoodId { get; set; }

        /* the name of the food, not including the brand name. E.G.: "Instant Oatmeal". */
        [XmlElement("food_name")]
        public string FoodName { get; set; }

        /*  takes the value "Brand" or "Generic". Indicates whether the food is a brand or generic item – see food_type */
        [XmlElement("food_type")]
        public string FoodType { get; set; }

        /* the brand name, only when food_type is "Brand". E.G.: "Quaker". */
        [XmlElement("brand_name")]
        public string BrandName { get; set; }

        /* URL of this food item on www.fatsecret.com. */
        [XmlElement("food_url")]
        public string FoodUrl { get; set; }

        /* A summary description of key nutritional values for a nominated serving size. */
        [XmlElement("food_description")]
        public string FoodDescription { get; set; }
    }


}
